#ifndef BIG_INT
#define BIG_INT

#include <string>
#include <vector>
#include <fstream>
#include <algorithm>
#include "opt_vector.h"

class big_int
{
	private:
	static const int base = 1000000000;
	static const int base_length = 9;

	bool sign;
	long long shift;
	opt_vector digits;

	void remove_zeroes();
	void restore();

public:
	big_int();
	big_int(long long);
	big_int(std::string&);
	big_int(const opt_vector&);

	big_int abs(const big_int&);
	long long compare(const big_int&) const;
	long long find_divider(const big_int&);
	std::pair <big_int, big_int> division(const big_int& number);
	friend int length(const int&);


	big_int  operator -  () const;
	big_int& operator += (const big_int&);
	big_int& operator -= (const big_int&);
	big_int& operator *= (const big_int&);
	big_int& operator /= (const big_int&);
	big_int& operator %= (const big_int&);

	big_int operator + (const big_int&) const;
	big_int operator - (const big_int&) const;
	big_int operator * (const big_int&) const;
	big_int operator / (const big_int&) const;
	big_int operator % (const big_int&) const;

	bool operator == (const big_int&) const;
	bool operator != (const big_int&) const;
	bool operator  > (const big_int&) const;
	bool operator  < (const big_int&) const;
	bool operator <= (const big_int&) const;
	bool operator >= (const big_int&) const;

	friend std::istream& operator >> (std::istream&, big_int&);
	friend std::ostream& operator << (std::ostream&, big_int&); 
};
#endif


